// 混合类的东西
import BackTop from 'components/content/backTop/BackTop'
export const backTopMixin = {
    data() {
        return {
            isShowBackTop: false,
        }
    },
    components: {
        BackTop
    },
    methods: {
        // 返回顶部
        backClick(){
            this.$refs.scroll.scrollTo(0,0,500);
        },
        listenShowBackTop(position) {
            // 判断BackTop是否显示
            this.isShowBackTop = position.y<-500;
        },

    },
}

export const tabControlMixin = {
    data: function () {
      return {
        currentType: 'pop'
      }
    },
    methods: {
      tabClick(index) {
        switch (index) {
          case 0:
            this.currentType = 'pop'
            break
          case 1:
            this.currentType = 'new'
            break
          case 2:
            this.currentType = 'sell'
            break
        }
        console.log(this.currentType);
      }
    }
  }
  